{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href={% static 'bootstrap-3.3.7-dist/css/bootstrap.min.css' %}>
    <style>
        .account{
            width: 400px;
            margin: auto;
        }
        form{
            color: #0f0f0f;
        }
    </style>
</head>
<body>
    {% csrf_token %}
    <div class="account">
    <form action="" method="post" novalidate>
    <h1 style="text-align: center">注册</h1>
    {% for field in form %}
        {% if field.name == 'code' %}
            <div class="form-group">
             <label for="{{field.id_for_label}}">{{ field.label }}</label>
             <div class="clearfix">
                 <div class="col-md-6" style="padding-left: 0">{{ field }} {{ field.errors.0 }}</div>
                 <div class="col-md-6"><input type="button" class="btn btn-default" value="发送验证码"></div>
             </div>
            </div>
        {% else %}
            <div class="form-group">
             <label for="{{field.id_for_label}}">{{ field.label }}</label>
             {{ field }} {{ field.errors.0 }}
            </div>
        {% endif %}
    {% endfor %}
        <button type="submit" class="btn btn-primary">提交</button>
    </form>

    </div>
<script src=""></script>
</body>
</html>